#ifndef AUDIOENCODETASK_H
#define AUDIOENCODETASK_H

#include <ClientImpl/Receive_handler.h>
#include <Task_Base/Task_Base.h>
#include <libavinclude.h>
#include <faac.h>
class AudioEncodeTask: public Task_Base ,public Receive_handler
{
public:
    AudioEncodeTask(Receive_handler*);

    ~AudioEncodeTask();
public:
    virtual int close();

    virtual bool receive_handler(char *data,int size);
protected:
    virtual int svc();//主动工作线程函数
private:

    Receive_handler *m_pHandler;

    FILE            *outfile;

    AVCodecContext  *Enc_AvContext;

    AVCodec         *Enc_AudioCodec;

    AVFrame         *pCacheFrame;

    uint8_t         *out_buffer;

    int              out_buffer_size;

    int m_pack_num1;
    int m_pack_num2;
};

#endif // AUDIOENCODETASK_H
